import createAxios, { getUrl } from '/@/utils/axios'
import { useAdminInfo } from '/@/stores/adminInfo'
import { adminBaseRoutePath } from '/@/router/static/adminBase'

const controllerUrl = adminBaseRoutePath + '/shop.order.Export'
const adminInfo = useAdminInfo()

// 获取导出表头
export const getTableHeadField = () => {
    return createAxios({
        url: controllerUrl + '/getTableHeadField',
        method: 'get',
    })
}

export const retryTask = (params: anyObj) => {
    return createAxios({
        url: controllerUrl + '/retryTask',
        method: 'post',
        data: params,
    })
}

// 获取下载地址
export const getDownloadUrl = (url: string) => {
    return getUrl() + url + '?batoken=' + adminInfo.getToken() + '&server=1'
}
